package com.mjw.zstu.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mjw.zstu.entity.Exhibition;
import com.mjw.zstu.entity.Exhibitor;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface ExhibitorMapper extends BaseMapper<Exhibitor> {
    @Select("select place_number,last_place from exhibitor,exhibition where exhibition.id=exhibitor.exhibition_id AND exhibition.id=#{exhibition_id}")
    public List<Map> hasplace(int exhibiton_id);
    @Select("select company.company_name,company.company_id,company.emergency_people,company.emergency_contact from exhibitor,exhibition,company where exhibition.id=exhibitor.exhibition_id AND exhibition.id=#{exhibition_id} AND company.company_id=exhibitor.company_id")
    public List<Map> Exhibitor(int exhibiton_id);
    @Select("select exhibition.*,company.company_name,company.emergency_people,company.emergency_contact from exhibitor,exhibition,company where exhibition.company_id=company.company_id AND exhibition.id=exhibitor.exhibition_id AND exhibitor.company_id=#{company_id}")
    public List<Map> companyExhibition(int company_id);

}
